package com.industrial.premu.mapper;

import java.util.List;
import java.util.Map;

import com.industrial.premu.domain.PreMuBenefitEvaluation;
import com.industrial.premu.domain.vo.ExternalVo;
import com.industrial.premu.dto.PreMuAreaTreeDto;
import com.industrial.premu.dto.PreMuBenefitEvaluationDto;
import com.industrial.premu.dto.PreMuChartsDto;
import com.industrial.premu.vo.*;
import com.industrial.premu.domain.sqsj.PreMuImportBenefitEvaluation;
import com.industrial.system.api.domain.EmEnterpriseInformationCollection;
import org.apache.ibatis.annotations.Param;

/**
 * 亩产效益评价Mapper接口
 * 
 * @author ZHOU_S
 * @date 2024-01-25
 */
public interface PreMuBenefitEvaluationMapper 
{
    /**
     * 查询亩产效益评价
     * 
     * @param id 亩产效益评价主键
     * @return 亩产效益评价
     */
    public PreMuBenefitEvaluation selectPreMuBenefitEvaluationById(String id);

    /**
     * 查询亩产效益评价列表
     * 
     * @param preMuBenefitEvaluation 亩产效益评价
     * @return 亩产效益评价集合
     */
    public List<PreMuBenefitEvaluation> selectPreMuBenefitEvaluationList(PreMuBenefitEvaluationDto preMuBenefitEvaluation);
    public List<PreMuBenefitEvaluation> selectPreMuBenefitEvaluationExporetList(PreMuBenefitEvaluation preMuBenefitEvaluation);

    /**
     * 新增亩产效益评价
     * 
     * @param preMuBenefitEvaluation 亩产效益评价
     * @return 结果
     */
    public int insertPreMuBenefitEvaluation(PreMuBenefitEvaluation preMuBenefitEvaluation);

    /**
     * 修改亩产效益评价
     * 
     * @param preMuBenefitEvaluation 亩产效益评价
     * @return 结果
     */
    public int updatePreMuBenefitEvaluation(PreMuBenefitEvaluation preMuBenefitEvaluation);

    /**
     * 删除亩产效益评价
     * 
     * @param id 亩产效益评价主键
     * @return 结果
     */
    public int deletePreMuBenefitEvaluationById(String id);

    /**
     * 批量删除亩产效益评价
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deletePreMuBenefitEvaluationByIds(String[] ids);
    /**获取详情**/
    PreMuBenefitEvaluationVo getById(String id);

    List<PreMuBenefitEvaluation> list(PreMuBenefitEvaluation benefitEvaluationQueryParams);


    void saveBatch(List<PreMuBenefitEvaluation> addImportList);

    void updateBatch(List<PreMuBenefitEvaluation> updateImportList);

    void batchSaveByImportInfo(List<PreMuImportBenefitEvaluation> addImportEvaluationList);

    void batchUpdateByImportInfo(List<PreMuImportBenefitEvaluation> updateImportEvaluationList);


    void removeCollectData(PreMuBenefitEvaluation preMuBenefitEvaluation);

    List<PreMuBenefitEvaluation> getAllSumScore(PreMuBenefitEvaluationDto preMuBenefitEvaluation);

    List<PreMuBenefitEvaluationVo> getExportList(PreMuBenefitEvaluation preMuBenefitEvaluation);

    List<PreMuIndustryBenefitEvaluationVo> getExportListGroupIndustry(PreMuBenefitEvaluation preMuBenefitEvaluation);

    List<PreMuLevelBenefitEvaluationVo> getExportListGroupLevel(PreMuBenefitEvaluation preMuBenefitEvaluation);

    void updateBatchNew(@Param("list") List<PreMuBenefitEvaluation> updateList);
    /**
     * <p>
     *     查询未试算的数据
     * </p>
     * @param queryNoCheckDataParams
     * @return
     */
    List<PreMuBenefitEvaluation> selectPreMuBenefitEvaluationListBySumScoreIsNull(@Param("dx") PreMuBenefitEvaluation queryNoCheckDataParams,@Param("sfwk") String sfwk);


    void updateLevelByIds(@Param("level") String level,@Param("ids")List<String> aIds);

    int count(PreMuBenefitEvaluationDto queryParams);

    List<String> getIdsBySumScore(Map<String, Object> paramMap);

    void updateMjLevelByIds(@Param("idList") List<String> idList, @Param("level") String level,@Param("ratingMark") String ratingMark);

     //--------------------------评价数据分析------------------------------------------------------------
    List<PreMuChartsVo> groupDimensionLevel(PreMuChartsDto preMuChartsDto);

    List<PreMuChartsVo> groupProportionLevel(PreMuChartsDto preMuChartsDto);

    PreMuScheduleManagementVo  groupArea(PreMuBenefitEvaluation preMuBenefitEvaluation);

    List<PreMuBenefitEvaluation> getVillageCount(String countyCode);

    List<PreMuBenefitEvaluation> getCountyCount(String cityCode);

    List<PreMuChartsVo>  getPj(PreMuAreaTreeDto areaTreeDto);

    List<PreMuChartsVo> groupDimensionArea(PreMuChartsDto preMuChartsDto);

    List<PreMuChartsVo> groupIndexByCity(PreMuChartsDto preMuChartsDto);

     PreMuChartsVo getAvgNum(PreMuChartsDto preMuChartsDto);

    List<PreMuChartsVo> groupIndexByIndustry(PreMuChartsDto preMuChartsDto);

    List<PreMuChartsVo> groupAreaIndustry(PreMuChartsDto preMuChartsDto);

    List<PreMuChartsVo> groupCompanyByIndustry(PreMuChartsDto preMuChartsDto);


    List<PreMuChartsVo> groupByArea(PreMuChartsDto preMuChartsDto);

    List<PreMuChartsVo> groupByAreaIndustry(PreMuChartsDto preMuChartsDto);


    List<PreMuChartsVo> groupEconomyByYears(PreMuChartsDto preMuChartsDto);

    List<PreMuChartsVo>  economyGruopArea(PreMuChartsDto preMuChartsDto);

    List<PreMuChartsVo> economyGruopIndustry(PreMuChartsDto preMuChartsDto);

    PreMuGradingRatioVo getGradingRatioVo(PreMuBenefitEvaluation preMuBenefitEvaluation);

    void updateStatusByIds(@Param("idList") List<String> idList);

    void updateVerifyByIds(@Param("idList") List<String> idList);
    /**
     * 获取取消评级的数据
     * @param chartsDto
     * @return
     */
    List<PreMuBenefitEvaluation> getTotal(PreMuChartsDto chartsDto);

    /**
     * 清除评级信息
     * @param list
     */
    void cleanLevel(@Param("list") List<String> list);


    /**
     * 改变档位
     * @param params
     * @return
     */
    int changeMjLevel(PreMuBenefitEvaluation params);

    /**
     * 通过企业ID更新企业名称
     * @param preMuBenefitEvaluation
     */
    void updatePreMuBenefitEvaluationCompanyNameByCompanyId(PreMuBenefitEvaluation preMuBenefitEvaluation);


    List<PreMuChartsVo> groupCounty(PreMuChartsDto preMuChartsDto);

    PreMuProgressAnalysisVo getCountyPingJ(PreMuBenefitEvaluation preMuBenefitEvaluation );

    List<PreMuAreaVo> groupAreas();


    /**
     * 查询亩产列表返回原status
     * @param params
     * @return
     */
    List<PreMuBenefitEvaluation> selectPreMuBenefitEvaluationListOrStatus(PreMuBenefitEvaluation params);

    /**
     * <p>
     *  查询白名单的基础数据<br/>
     *  数据来源亩产
     * </p>
     *
     * @param id
     * @return
     */
    EmEnterpriseInformationCollection queryWhiteCompanyInfoById(@Param("id") String id);

    void updateStatusDpjByIds(@Param("idList") List<String> dssCompanyIds);

    /**
     * 查询区县中所有得分是0的数据
     * @param paramMap
     * @return
     */
    List<String> selectCurrentCoutnySorceEqZero(Map<String, Object> paramMap);

    /**
     * 查询当前区县当前年当前企定类型是否汇入过数据
     * @param preMuBenefitEvaluation
     * @return
     */
    Integer selectCurrentCountyHrData(PreMuBenefitEvaluation preMuBenefitEvaluation);

    /**
     * 查询需要核实的数据
     * @param preMuBenefitEvaluation
     * @return
     */
    List<PreMuBenefitEvaluation> selectPreMuBenefitEvaluationHsList(PreMuBenefitEvaluation preMuBenefitEvaluation);

    List<PreMuBenefitEvaluation> selectUsccAndIdList(PreMuBenefitEvaluation benefitEvaluationQueryParams);

    /**
     * 查询企业Id
     * @param preMuBenefitEvaluation
     * @return
     */
    List<String> selectPreMuBenefitCompanyId(PreMuBenefitEvaluation preMuBenefitEvaluation);

    int updateSores(PreMuBenefitEvaluation preMuBenefitEvaluation);

    int selectDataCount(@Param("year") String year, @Param("companyType")String companyType, @Param("county")String county);

    /**
     * 通过Id查询已存在的企业数量
     * @param ids
     * @return
     */
    int getCountByIds(@Param("ids") String[] ids);

    PreMuBenefitEvaluationVo gropAreasByCode(@Param("county")String county);

    PreMuBenefitEvaluationVo groupIndustry(@Param("id")String id);

    /**
     * 对石工提供的数据
     * @return
     */
    List<ExternalVo> selectExternalPageList();

    public int selectDiffrentCalTypeCount(PreMuBenefitEvaluationDto preMuBenefitEvaluation);

    List<String> getAllIdsSortedBySumScore(Map<String, Object> paramMap);


}
